<?php
/*
 * 公司视频
 */
namespace app\index\controller;

use app\common\controller\IndexBase;
use think\facade\Session;
use think\facade\Db;

class CompanyVideo extends IndexBase
{
    protected function initialize()
    {
        parent::initialize();
    }

    public function index()
    {
        $param = $this->request->param();
        $type = ["全部视频","消费者","创业者","供应商","小伙伴"];
        if (!empty($param['c_name']) && $param['c_name'] != '全部视频') {
            $where = ['type'=>array_search($param['c_name'],$type)];
        }else{
           $where = 1;
        }
        $lists = Db::table('video')->where(['status'=>1,'delete_time'=>0])->where($where)->orderRand()->select();
    	return $this->fetch('',['page_title'=>'公司视频','lists'=>$lists,'group'=>$type]);
    }

}